//
//  Utilities.h
//  ios-loan
//
//  Created by ys on 15/12/2017.
//  Copyright © 2017 hxhg. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ALUtilsMacro.h"

typedef NS_ENUM(NSInteger, AppStoreState) {
    AppStoreStateNone=111,
    AppStoreStateTrue,
    AppStoreStateFalus
};
@protocol AppStoreStateDelegate <NSObject>
- (void)appStoreStateResult:(AppStoreState)theStoreState;
@end

@interface Utilities : NSObject
@property (nonatomic, weak) id<AppStoreStateDelegate> theStateDelegate;
@property (nonatomic, assign) BOOL isAppStore; //是否是AppStore,默认YES
@property (nonatomic, assign) AppStoreState isAppStoreState; //是否是AppStore,默认YES
AL_AS_SINGLETON(Utilities)


+ (NSString *)appCode;

+ (NSString *)appVersion;

+ (NSString *)getValidatTimeKeyString;

//base64
+ (NSString *)encodeString:(NSString *)sourceString;

+ (NSString *)documentPath;

+ (NSString *)cachePath;

+ (NSArray<NSDictionary *> *)getCitysWithAdcodes:(NSArray<NSString *> *)adcodes;


/**
 hostUrl配置

 @return hostUrl
 */
//+ (NSString *)hostUrlUtils;


/**
 分享url配置

 @return 返回处理好的分享url
 */
//+ (NSString *)shareUrl;


//+ (NSString *)questionUrl;

+ (NSString *)getApiByKey:(NSString *)key;
+ (NSString *)getChannelByKey:(NSString *)key;
/**
 
 
 @param backBlock <#backBlock description#>
 */
- (void)hasAppStore:(void(^)(AppStoreState hasAppStore))backBlock;
- (void)hasAppStore2:(id<AppStoreStateDelegate>)delegate;
@end
